package com.nulldev.util.web.HttpServer3.extensions.websocket;

import com.nulldev.util.web.HttpServer3.Page;
import com.nulldev.util.web.HttpServer3.extensions.websocket.util.CloseReason;

public interface IWebSocketPage extends Page {
	void onPeerConnect(final Peer peer);

	void onTextMessage(final Peer peer, final String message);

	void onBinaryMessage(final Peer peer, final byte[] message);

	void onPeerClose(final Peer peer, final CloseReason reason);

	public String getID();

	public default boolean prefersLowLatency() {
		return false;
	}

	public default boolean hasProtocolName() {
		return false;
	}

	public default String getProtocolName() {
		return null;
	}
}
